package random.fox.p2p.ui.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import random.fox.p2p.R;

/**
 * Created by delong on 2015/4/2.
 */
public class CustomView extends LinearLayout {
    View root;

    public ImageView mImg;
    private ImageView oneHeadImg, twoHeadImg, threeHeadImg;
    private TextView one, two, three;

    public CustomView(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater layoutInflater = LayoutInflater.from(context);
        root = layoutInflater.inflate(R.layout.custom_view_layout, this, true);
        mImg = (ImageView) root.findViewById(R.id.mid_img);
        oneHeadImg = (ImageView) root.findViewById(R.id.head_one);
        twoHeadImg = (ImageView) root.findViewById(R.id.head_two);
        threeHeadImg = (ImageView) root.findViewById(R.id.head_three);
        one = (TextView) root.findViewById(R.id.reply_one_text);
        two = (TextView) root.findViewById(R.id.reply_two_text);
        three = (TextView) root.findViewById(R.id.reply_three_text);
        setData();
    }

    public void setData() {
        // int count = list.size()>=3 ? 3:list.size();
        oneHeadImg.setVisibility(INVISIBLE);
        twoHeadImg.setVisibility(INVISIBLE);
        threeHeadImg.setVisibility(INVISIBLE);
        one.setVisibility(INVISIBLE);
        two.setVisibility(INVISIBLE);
        three.setVisibility(INVISIBLE);
//        one.setText("aaaaaaaaaaaaaaaaaaaaaa");
//        two.setText("bbbbbbbbbbbbbbbbbbbbb");
//        three.setText("cccccccccccccccccccc");
    }
}
